import React, { Component } from 'react';
import '../../styles/MySwiper.css'
import { Swiper, } from 'antd-mobile'
import propTypes from 'prop-types'
class MySwiper extends Component {
    render() {
        return (
            <div className='swiper'>
        <Swiper autoplay loop>{
            this.props.swiperlist.map((item,index)=>{
                return (
                    <Swiper.Item key={index}>
                       <img src={item.pic} alt="" />
                    </Swiper.Item>
                )
            })
        }</Swiper>       
            </div>
        );
    }
}
//类型验证，但是报错
// MySwiper.propTypes={
//     swiperlist:{type:propTypes.array,default:[]}
// }
export default MySwiper;